package com.trianing.java.cor.equal;

public class Car {

	private String VinNumber;
	private String Make;
	private String Model;
	
	public Car(String VinNumber,String Make,String Model )
	{
		this.VinNumber=VinNumber;
		this.Make=Make;
		this.Model=Model;	
	}
	
	@Override
	public boolean equals(Object obj)
	{
	
		if(obj instanceof Car)
		{
		Car car2=(Car)obj;
		return this.VinNumber.equals(car2.VinNumber);
		}
		else
		{
			return false;
		}
	}
	
	@Override
	public int hashCode()
	{
		return VinNumber.hashCode()+Make.hashCode()+Model.hashCode();
		
	}
	}
